package expressions.slogo;

public enum Priority
{
    LOGICAL(0), RELATIONAL(1), ARITHMETIC(2), FUNCTION(3);

    private final int value;

    Priority(int value)
    {
        this.value = value;
    }

    public int lowest()
    {
        return value * Modifier.RANGE;
    }

    public int highest()
    {
        return (value + 1) * Modifier.RANGE - 1;
    }

    public int adjust(Modifier mod)
    {
        return value * Modifier.RANGE + mod.getValue();
    }
}
